View Editor

In SQL Editor tab, you can create and edit the SELECT statement SQL for a view. Navicat Data Modeler provides a wide range advanced features for editing the view definition, such as compelling code editing capabilities, smart code-completion, sql formatting, and more.

Hint: SELECT statement will be automatically generated while you build in View Builder.

Beautify SQL

To format messy SQL code into a well-structured script, you can click the Beautify SQL button. To minify SQL code by removing spaces, tabs and newlines, control-click the editor and select Minify SQL.

Code Completion

Code completion feature in Navicat Data Modeler pops up a list of suggestions as you type your SQL statement in the editor. It assists you with statement completion and the available properties of database objects, for example databases, tables, fields, views etc with their appropriate icons and information.

To invoke code completion, just simply press '.' for the available properties of database object currently in the scope.

When the suggestion list appears, press TAB to insert the first item. You can also select the needed item using UPPER ARROW or DOWN ARROW and then press TAB or ENTER.

In addition, code completion can be invoked by typing a character or pressing ESC on your keyboard for SQL keywords/database objects.

If you select a snippet name from the list, the saved code will be inserted to the editor.

Hint: Resize the suggestion list by dragging the lower right corner.

You can enable or disable the code completion feature in Settings.

Clipboard Stack

When you copy or cut some codes as usual in the editor, the copied content will also be added to Clipboard Stack. Clipboard Stack can store up to 10 items and use the last-in-first-out logic. To paste an item from Clipboard Stack, you can press COMMAND-SHIFT-V. Press COMMAND-SHIFT-V multiple times to cycle through Clipboard Stack.

Code Folding

Code folding feature enables you to collapse blocks of code such that only the first line of the block appears in the editor.

A block of code that can be folded is indicated by an icon Fold to the left of the first line of the block. A vertical line extends from the icon to the bottom of the foldable code. In contrast, a folded block of code is indicated by an icon UnFold to left of the code block. You can fold the block by clicking Fold or expand it by clicking UnFold.

Syntax Highlight

Navicat Data Modeler uses syntax highlighting which depending on the database associated with the query. Different databases have different sets of reserved keywords. You can configure the associated colors for different text fragments in Settings.

Brace Highlight

Navicat Data Modeler supports to highlight the matching brace in the editor, i.e. () .

Note: The cursor must be on a brace to show the highlight.

Find and Replace

Find

The Find bar is provided for quick searching for the text in the editor. Just simply choose Edit -> Find from the menu or press COMMAND-F, and then enter a search string.

Incremental searching is used here. As you type, the matched text is found and highlighted instantly. This saves your time from typing the entire text.

The search starts at the cursor's current position to the end of the file.

To find the previous or next occurrence, just simply click Find Previous or Find Next.

Replace

To open the Replace bar, simply choose Edit -> Find -> Find and Replace from the menu bar or press OPTION-COMMAND-F. Then, enter the text you want to search and replace.

Click the Replace button to replace the first occurrence.

Click the Replace All button to replace all occurrences automatically.

There are some additional options for Find and Replace, click Find:

Option

Description

Regular Expression

Search regular expressions.

Match Case

Enable case sensitive search.

Whole Word

Return the objects that match the entire word of the search string.

Copy with Quotes

To copy the SQL statement with quotes, just simply control-click the highlighted SQL. Then, select Copy with Quotes and choose the format.

Zoom In/Zoom Out

Navicat Data Modeler has the ability to zoom in or zoom out the SQL in the editor.

Zoom In: [COMMAND-+]

Zoom Out: [COMMAND--]

Reset: [COMMAND-0]